package com.whenjun.mapper;

import com.whenjun.dto.kq.LastRecordByPersonIdAndInGroupTypeReq;
import com.whenjun.dto.kq.LastRecordReq;
import com.whenjun.entity.IscDoorRecord;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author whenjun
 * @since 2024-02-27
 */
public interface IscDoorRecordMapper extends BaseMapper<IscDoorRecord> {

    Integer countIndexCodeInGroupType(@Param("indexCode") String indexCode, @Param("groupCode") String groupCode);

    IscDoorRecord selectLastRecordBySrcIndexAndPersonId(LastRecordReq lastRecordReq);

    /**
     * 根据人员id和考勤点类型查询 上次通道记录
     * @return
     */
    IscDoorRecord selectLastRecordByPersonIdAndGroupType(@Param("personId") String personId, @Param("groupType") String groupType);

    /**
     * 根据人员id和考勤点类型查询 上次通道记录  集合
     * @return
     */
    IscDoorRecord selectLastRecordByPersonIdAndInGroupType(LastRecordByPersonIdAndInGroupTypeReq lastRecordByPersonIdAndInGroupTypeReq);
}
